package com.example.piece.ui.adapter

import android.view.View
import android.widget.Toast
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.listener.OnItemClickListener
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.base.ext.navigationTo
import com.example.base.ext.setCornersPlaceHolderImageUrl
import com.example.base.tools.JsonTool
import com.example.piece.BR
import com.example.piece.R
import com.example.piece.constant.Key
import com.example.piece.constant.RoutePath
import com.example.piece.databinding.*
import com.example.piece.entity.JokesVideoLikeListEntity
import com.example.piece.entity.UserAttentionListEntity
import com.example.piece.entity.UserCommentListEntity
import com.example.piece.entity.UserMessageSystemEntity
import com.wenming.library.encryption.imp.AESEncode

class ZPVideoAdapter :
    BaseQuickAdapter<JokesVideoLikeListEntity, BaseDataBindingHolder<ItemZpVideoBinding>>(
        R.layout.item_zp_video
    ), LoadMoreModule {


    override fun convert(
        holder: BaseDataBindingHolder<ItemZpVideoBinding>,
        item: JokesVideoLikeListEntity,
    ) {


        val binding =
            holder.dataBinding
        val variable = binding?.setVariable(BR.entity, item)
        binding?.setVariable(BR.adapter, this)
        binding?.setVariable(BR.position, holder.layoutPosition)
        val imgUrl =
            AESEncode.Decrypt(
                item?.cover?.split(",")?.get(0)?.replace("ftp://", "").toString().trim(),
                "cretinzp**273846"
            )

        binding?.img?.setCornersPlaceHolderImageUrl(imgUrl,1,R.drawable.bg_empty)


        binding?.executePendingBindings()
    }


}